

function addSensorbitCod(Blockly) {




    //磁簧开关传感器模块
    Blockly.Python.microbit_reed_switch = function(block) {
        var dropdown_reedPort = this.getFieldValue('reedPort');
        Blockly.Python.definitions_['import_microbit'] = 'from microbit import *';
        Blockly.Python.definitions_['import_Magneticswitch'] = 'from sensor import magnetic';
        var code = "magnetic.is_detected("+ dropdown_reedPort +")";
        return [code];
      }

    return Blockly;
}

module.exports = addSensorbitCod;

